package com.byinsight.web.actions.dimension;

import com.byinsight.web.actions.CheckSessionAction;

import eg.backend.base.PermissionType;
import eg.backend.domain.Dimension;

//create a dimension (not a dimension item)
public class CreateDimensionAction extends CheckSessionAction {
	private static final long serialVersionUID = -3218242971782020616L;
	private String name;
	private String desc;
	
	@Override
	protected String process() {
		Dimension dimension = new Dimension();
		dimension.setName(name);
		dimension.setDescription(desc);
		dimension.setPermission(PermissionType.PRIVATE);
		dimension.setChildPosition(0);
		dimension.setPosition("0.");
		dimensionManager.addDimension(dimension);
		return null;
	}
	
	/* common */
	public void setName(String name) {
		this.name = name;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
